home *** CD-ROM | disk | FTP | other *** search
/ Isometric Game Programming with DirectX 7.0 / Isometric Game Programming.iso / source / chapter13 / isohex13_2 / gdicanvas.h < prev    next >
C/C++ Source or Header  |  2000-05-18  |  1KB  |  58 lines

  1. // GDICanvas.h: interface for the CGDICanvas class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4.  
  5. #if !defined(AFX_GDICANVAS_H__F5EB4F68_2CBC_11D4_A1EE_8F7A3049432E__INCLUDED_)
  6. #define AFX_GDICANVAS_H__F5EB4F68_2CBC_11D4_A1EE_8F7A3049432E__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12. #include <windows.h>
  13.  
  14. //GDICanvas--wrapper for a dc and a bitmap
  15. class CGDICanvas  
  16. {
  17. private:
  18.     //memory dc
  19.     HDC hdcMem;
  20.  
  21.     //new bitmap
  22.     HBITMAP hbmNew;
  23.  
  24.     //old bitmap
  25.     HBITMAP hbmOld;
  26.  
  27.     //width and height
  28.     int nWidth;
  29.     int nHeight;
  30.  
  31. public:
  32.     //constructor
  33.     CGDICanvas();
  34.  
  35.     //loads bitmap from a file
  36.     void Load(HDC hdcCompatible,LPCTSTR lpszFilename);
  37.  
  38.     //creates a blank bitmap
  39.     void CreateBlank(HDC hdcCompatible, int width, int height);
  40.  
  41.     //destroys bitmap and dc
  42.     void Destroy();
  43.  
  44.     //converts to HDC
  45.     operator HDC();
  46.  
  47.     //return width
  48.     int GetWidth();
  49.  
  50.     //return height
  51.     int GetHeight();
  52.  
  53.     //destructor
  54.     ~CGDICanvas();
  55. };
  56.  
  57. #endif // !defined(AFX_GDICANVAS_H__F5EB4F68_2CBC_11D4_A1EE_8F7A3049432E__INCLUDED_)
  58.